﻿@model IEnumerable<MVC4_Test.Models.QuestionTag>

@{
    ViewBag.Title = "Index";
}


<div id="content">
            

<div id="mainbar-full">
    <div class="subheader">
        <h1 id="h-tags">Tags</h1>
        <div id="tabs">
        <a class="youarehere" href="/tags?tab=popular" title="most popular tags">popular</a>
        <a href="/tags?tab=name" title="tags in alphabetical order">name</a>
        <a href="/tags?tab=new" title="recently created tags">new</a>
</div>
    </div>
    <div class="page-description">
        <p>
            A tag is a keyword or label that categorizes your question with other, similar questions. Using the right tags makes it easier for others to find and answer your question.
        </p>
        <table>
            <tr>
                <td>Type to find tags:</td>
                <td style="padding-left:5px"><input id="tagfilter" name="tagfilter" type="text"></td>            
            </tr>
        </table>
    </div>
    <div id="tags_list">
          
<table id='tags-browser'>
    
            <tr>
            @foreach (var item in Model)
            {
                <td class="tag-cell">
                    <a href="/question/tagged/@item.Tag.TagId" class="post-tag" title="show questions tagged @item.Tag.Text;" rel="tag">@item.Tag.Text</a><span class="item-multiplier"><span class="item-multiplier-x">&times;</span>&nbsp;<span class="item-multiplier-count">@Model.Where(p => p.TagId == item.TagId).Count()</span></span>
                        <div class='excerpt'>De model heeft nog geen text field</div>
                    <div>
                        <div class='stats-row fl'><a 
                                    href="/question/tagged/@item.TagId?sort=newest&days=1" 
                                    title="@Model.Where(p=>p.QuestionId == item.QuestionId).Count() tagged c# in the last 24 hours">@Model.Where(p=>p.QuestionId == item.QuestionId).Count() asked today</a>, <a 
                                    href="/questions/tagged/c%23?sort=newest&days=7" 
                                    title="4706 questions tagged c# in the last 7 days">? this week</a></div>
                        <div class="cbt"></div>
                    </div>
                </td>
                
            }
            </tr>

</table>

    <div class="pager fr">
        
 <span class="page-numbers current">1</span>         <a href="/tags?page=2&amp;tab=popular" title="go to page 2"> <span class="page-numbers">2</span> </a> 
        <a href="/tags?page=3&amp;tab=popular" title="go to page 3"> <span class="page-numbers">3</span> </a> 
        <a href="/tags?page=4&amp;tab=popular" title="go to page 4"> <span class="page-numbers">4</span> </a> 
        <a href="/tags?page=5&amp;tab=popular" title="go to page 5"> <span class="page-numbers">5</span> </a> 
 <span class="page-numbers dots">…</span>         <a href="/tags?page=1058&amp;tab=popular" title="go to page 1058"> <span class="page-numbers">1058</span> </a> 
        <a href="/tags?page=2&amp;tab=popular" rel="next" title="go to page 2"> <span class="page-numbers next"> next</span> </a> 

    </div>


    </div>

    <div id="tags-legend">

        <span>
            <a class="tag-synonym-link" href="/tags/synonyms" title="show all tag synonyms">tag synonyms</a>
        </span>
    </div>

    <script>
        StackExchange.ready(function () {
            $("#tagfilter").focus().typeWatch({ highlight: true, wait: 500, captureLength: -1, callback: finished });
        });

        function finished(txt) {
            $.ajax({
                type: "POST",
                url: "/filter/tags-for-index",
                data: { filter: txt, tab: 'Popular' },
                dataType: "html",
                success: function (result) {
                    var domelement = $(result);
                    $("#tags_list").html(domelement);

                    if (txt == "") {
                        $(".pager").show();
                    } else {
                        $(".pager").hide();
                    }

                }
            });
        }
    </script>
</div>